#include<iostream>
using namespace std;
const int N = 1e6 + 10;
int x, y;
int main()
{
	
	cin >> x >> y;
	for (int i = 0; i <= x; i++) {
		int a = 1000 * i;
		int temp = y - a;
		if (temp % 2500 == 0) {
			int d = x - i - temp / 2500;
			cout << d << " " << i << " " << temp / 2500 << endl;
			return 0;
		}
	}
	cout << -1 << endl;
	//cout << 334 * 1000 + 466 * 2500 << endl;
	return 0;
}